Week 11 - Overview

Learning Summary

1. Device Types

Introduction to various input devices such as sensors for temperature, light, motion, and distance, as well as switches and potentiometers.

2. Integration and Programming

Guidance on integrating these devices with microcontrollers and programming them for data capture and interaction.

3. Applications

Demonstrations of how these devices can be applied in real-world projects and systems.


Individual Assignment

Group Assignment


Reference Links

Week11 Input Devices Guide for my Fab Academy Journey.


My personal assignment

1.Summarize the core knowledge points of Input Devices.

In this lesson, I learned about a variety of input sensors, including analog and digital signal inputs.
There are many types, involving the collection of various data, which is very interesting.

1. Temperature Sensors

2. Light Sensors

3. Motion Sensors

4. Distance Sensors

5. Switches

6. Potentiometers

2.Tools、Software & Machine Introduction

Software:Kicad KiCad is a free and open-source electronics design automation (EDA) suite.
It features schematic capture, integrated circuit simulation, printed circuit board (PCB) layout, 3D rendering, and plotting/data export to numerous formats.
KiCad also includes a high-quality component library featuring thousands of symbols, footprints, and 3D models.
KiCad has minimal system requirements and runs on Linux, Windows, and macOS.

  • Visit Kicad website for more information.
  • Download Kicad from here.
    Learn the various functions of KiCad.




  • Arduino IDE:
    Arduino IDE (Integrated Development Environment) is an open-source software used for writing and uploading code to Arduino-compatible boards.
    It provides an easy-to-use environment for both beginners and professionals to develop various electronic and robotic projects.
  • Visit Arduino website for more information.
  • Download Arduino from here.



  • Tools:oscilloscope An oscilloscope is a crucial tool in electronics, enabling the visualization of electrical signal voltages as waveforms over time.
    It offers various features:
    • Display: Shows electrical signals as waveforms, with voltage on the vertical axis and time on the horizontal axis.
    • Channels: Allows multiple signals to be viewed simultaneously.
    • Bandwidth: Determines the frequency range the oscilloscope can measure accurately.
    • Sampling Rate: The rate at which the oscilloscope samples the signal, crucial for capturing fast-changing signals.
    • Triggering: Stabilizes repeating signals by starting data capture at a specific signal point.


    3.Input conmponents:DHT11

    The DHT11 is a basic, ultra-low-cost digital temperature and humidity sensor.
    It uses a capacitive humidity sensor and a thermistor to measure the surrounding air, and outputs a digital signal on the data pin (no analog input pins needed).
    It’s simple to use, but requires careful timing to grab data.
    Here are its key features:



    From the component library, locate the schematic symbols for the main components to be used: XiaoESP32-S3, DHT11.
    We can learn the usage information of the sensor from the datasheet.
    The Data Sheet for DHT11:
  • DHT11 Technical Data Sheet
  • The library of DHT11 component:
  • Grove_Temperature_And_Humidity_Sensor


  • here is the test code for DHT11:
    
                      // Example testing sketch for various DHT humidity/temperature sensors
                      // Written by ladyada, public domain
                      
                      #include "Grove_Temperature_And_Humidity_Sensor.h"
                      
                      // Uncomment whatever type you're using!
                      #define DHTTYPE DHT11   // DHT 11
                      //#define DHTTYPE DHT22   // DHT 22  (AM2302)
                      //#define DHTTYPE DHT21   // DHT 21 (AM2301)
                      //#define DHTTYPE DHT10   // DHT 10
                      //#define DHTTYPE DHT20   // DHT 20
                      
                      /*Notice: The DHT10 and DHT20 is different from other DHT* sensor ,it uses i2c interface rather than one wire*/
                      /*So it doesn't require a pin.*/
                      #define DHTPIN D6     // what pin we're connected to(DHT10 and DHT20 don't need define it)
                      DHT dht(DHTPIN, DHTTYPE);   //   DHT11 DHT21 DHT22
                      //DHT dht(DHTTYPE);         //   DHT10 DHT20 don't need to define Pin
                      
                      // Connect pin 1 (on the left) of the sensor to +5V
                      // Connect pin 2 of the sensor to whatever your DHTPIN is
                      // Connect pin 4 (on the right) of the sensor to GROUND
                      // Connect a 10K resistor from pin 2 (data) to pin 1 (power) of the sensor
                      
                      
                      #if defined(ARDUINO_ARCH_AVR)
                          #define debug  Serial
                      
                      #elif defined(ARDUINO_ARCH_SAMD) ||  defined(ARDUINO_ARCH_SAM)
                          #define debug  SerialUSB
                      #else
                          #define debug  Serial
                      #endif
                      
                      void setup() {
                      
                          debug.begin(115200);
                          debug.println("DHTxx test!");
                          Wire.begin();
                      
                          /*if using WIO link,must pull up the power pin.*/
                          // pinMode(PIN_GROVE_POWER, OUTPUT);
                          // digitalWrite(PIN_GROVE_POWER, 1);
                      
                          dht.begin();
                      }
                      
                      void loop() {
                          float temp_hum_val[2] = {0};
                          // Reading temperature or humidity takes about 250 milliseconds!
                          // Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
                      
                      
                          if (!dht.readTempAndHumidity(temp_hum_val)) {
                              debug.print("Humidity: ");
                              debug.print(temp_hum_val[0]);
                              debug.print(" %\t");
                              debug.print("Temperature: ");
                              debug.print(temp_hum_val[1]);
                              debug.println(" *C");
                          } else {
                              debug.println("Failed to get temprature and humidity value.");
                          }
                      
                          delay(1500);
                      }
                      
                    

    4.Programming Process

    1. Hardware Connection

    2. Software Configuration

    3.My program requirements

    In my next program, I hope to set the temperature and humidity within a certain range as conditions to trigger other actions.
    Therefore, I am adding conditions for temperature and humidity.
    I will print the real-time temperature and humidity values on the serial monitor.
    If they meet the required conditions, it will display "Suitable environment".
    Here is the code for my program:

    5.Some Problems and Solutions.

    1. DHT11 not working properly.

    When I completed my first PCB design, I was the fastest progressing member in our group.
    However, during the subsequent program testing, I found that the DHT11 was not functioning properly, and I smelled something burning.
    I realized there must have been a short circuit somewhere.
    After attempting to troubleshoot many times and burning out another DHT11 sensor, I discovered that a flaw in the circuit board design had caused me to connect the pins incorrectly, thereby damaging the DHT11 component.
    The circuit board I showed earlier is the correctly adjusted final design.
    Now, I'm also sharing the failed version.
    This reminds me to carefully and meticulously review the component datasheets to ensure correct installation.

    2.Do not get the correct temperature and humidity values.

    I found that the I forgot to correct the pin connections for the DHT11 sensor.
    After correcting the pin connections, I was able to get the correct temperature and humidity values.

    6.Using the Oscilloscope to Measure waveforms

    1. Set up the Oscilloscope:

    2. Connect the Probe:

    3. Adjust Settings:

    4. Trigger Settings:

    5. Analyze the Signal:

    The Hero Shots

    Here's my hero shot for this week.


    Team Assignment

    Week8 Electronics Design Group Assignment link.
    Oscilloscope An oscilloscope is a crucial tool in electronics, enabling the visualization of electrical signal voltages as waveforms over time.
    It offers various features:
    • **Display:** Shows electrical signals as waveforms, with voltage on the vertical axis and time on the horizontal axis.
    • **Channels:** Allows multiple signals to be viewed simultaneously.
    • **Bandwidth:** Determines the frequency range the oscilloscope can measure accurately.
    • **Sampling Rate:** The rate at which the oscilloscope samples the signal, crucial for capturing fast-changing signals.
    • **Triggering:** Stabilizes repeating signals by starting data capture at a specific signal point.



    Assignment files


    Let's Jump to the Top !!!